using System.Collections.Generic;
using System.Linq;
using Home.Site.Models.DataLayer;

namespace Home.Site.Models.WebUI
{
    public class MainViewModel
    {
        private readonly IReviewRepository reviewRepository;
        private readonly IPhotoRepository photoRepository;

        public MainViewModel(IReviewRepository reviewRepository, IPhotoRepository photoRepository) 
        {
            this.reviewRepository = reviewRepository;
            this.photoRepository = photoRepository;
            const int countReviews = 4;
            //Interest = reviewRepository.GetLastReviewByCategory(CategoryTypes.Interest,countReviews);
            //Games = reviewRepository.GetLastReviewByCategory(CategoryTypes.Games, countReviews);
            //Music = reviewRepository.GetLastReviewByCategory(CategoryTypes.Music, countReviews);
            //MusicCount = reviewRepository.All.Count(x =>x.Visible && x.CategoryID == (int) CategoryTypes.Music);
            //GamesCount = reviewRepository.All.Count(x => x.Visible && x.CategoryID == (int)CategoryTypes.Games);
            //InterestCount = reviewRepository.All.Count(x => x.Visible && x.CategoryID == (int)CategoryTypes.Interest);

            //Photos = photoRepository.All.Where(p => p.Main).ToArray();
        }

        public Review[] Interest { get; set; }
        public Review[] Games { get; set; }
        public Review[] Music { get; set; }
        public int MusicCount { get; set; }
        public int GamesCount { get; set; }
        public int WaksCount { get; set; }
        public int InterestCount { get; set; }


        public IEnumerable<Photo> Photos { get; set; }
    }
}